home *** CD-ROM | disk | FTP | other *** search
- /*
- ** Apple Macintosh Developer Technical Support
- **
- ** File: TRootObj.c
- ** Written by: Eric Soldan
- **
- ** Copyright © 1992 Apple Computer, Inc.
- ** All rights reserved.
- */
-
-
-
- /* See the files "=How to write your app" and "=Using TreeObj.c" for information
- ** on this function. */
-
- /* This file isn't really used for much here. The whole hierarchical document usage of
- ** DTS.Chat is very limited. It isn't actually needed at all. This file is here just
- ** so that there is more parallelism between DTS.Chat and other samples. Also, you may
- ** wish to expand this sample in such a way as to use the hierarchical document package.
- ** You are ready to do so if you so choose, as the minimum (this file) is already done. */
-
-
-
- /*****************************************************************************/
-
-
-
- #include "App.h" /* Get the application includes/typedefs, etc. */
- #include "App.Common.h" /* Get the stuff in common with rez. */
- #include "App.protos.h" /* Get the prototypes for application. */
-
- #ifndef __OSEVENTS__
- #include <OSEvents.h>
- #endif
-
- #ifndef __OSUTILS__
- #include <OSUtils.h>
- #endif
-
- #ifndef __QUICKDRAW__
- #include <Quickdraw.h>
- #endif
-
- #ifndef __STRING__
- #include <String.h>
- #endif
-
- #ifndef __UTILITIES__
- #include "Utilities.h"
- #endif
-
-
-
- #pragma segment DrawObjects
- long TRootObj(TreeObjHndl hndl, short message, long data)
- {
- short fileRefNum;
- char *cptr;
-
- switch (message) {
- case FREADMESSAGE:
- fileRefNum = data;
- return(ReadTreeObjData(hndl, fileRefNum));
- break;
-
- case FWRITEMESSAGE:
- fileRefNum = data;
- return(WriteTreeObjData(hndl, fileRefNum));
- break;
-
- case VHMESSAGE:
- #if VH_VERSION
- cptr = ((VHFormatDataPtr)data)->data;
- ccatchr(cptr, 13, 2);
- VHRootInfo(hndl, cptr);
- ccatchr(cptr, 13, 2);
- VHFileRecInfo(hndl, cptr);
- return(true);
- #endif
- break;
-
- default:
- break;
- }
-
- return(noErr);
- }
-
-
-
-